<script>
	$(document).ready(function(){
		var href = window.location.href;
		$(".product a").css({'color':'blue'});
		$("nav ul li.product").css({'color':'blue'});
		$("#checkall").click(function(){
				var checkall = $("#checkall").is(":checked");
				if(checkall == true){
					$(":checkbox").attr("checked","checked");
				}else{
					$(":checkbox").removeAttr("checked");
				}
		});
	});
</script>
<section class="content-header">
	<h1>Danh sách sản phẩm</h1>
	<nav>
		<ul>
			<li class="product"><a href="back/product">Tất cả sản phẩm</a></li>
			<li class="category"><a href="back/product/category">Danh mục sản phẩm</a></li>
		</ul>
	</nav>
</section><!--content-header-->
<section class="content-view">
	<section class="advance">
		<section class="search">
			<form method="get" action="back/product/search">
				<select name="option">
					<option value="1">Danh mục sản phẩm</option>
					<option value="2">Tất cả sản phẩm</option>
				</select>
				<input type="text" name="key" id="key" placeholder="Từ khóa.........." class="txtkey"value="<?php echo isset($key)?$key:'';?>"/>
				<input type="submit" value="Tìm kiếm" name="search" class="btnsearch"/>
			</form>
		</section><!--End Search-->
			<form method="post" action="back/product/delete_many">
				<section class="tool">
					<ul>
						<li><button><a href="back/product/create_product">Thêm mới</a></button></li>
						<li><input type ="submit" value="Xóa nhiều" name="delete_many" id="delete_many"></li>
						<li><input type ="submit" value="Hiển thị" id="show"></li>
					</ul>
				</section><!--End tool-->
	</section><!--End advance-->
	<section class="table">
		<table>
			<tr>
				<th>STT</th>
				<th><input type="checkbox" id="checkall"></th>
				<th>Tên Sản Phẩm</th>
				<th>Danh mục</th>
				<th>Mô tả</th>
				<th>Hình ảnh</th>
				<th>Giá</th>
				<th>Giảm giá</th>
				<th>Số lượng</th>
				<th>Thao tác</th>
			</tr>
			<tbody>
				<?php
					foreach($product as $product_info){
				?>
					<tr>
						<td class="product"><?php echo  $stt;?></td>
						<td class="product"><input  type="checkbox" name="check[]" value="<?php echo $product_info['id']?>"/></td>
						<td class="product name"><a href="#"><?php echo   $product_info['name'];?></a></td>
						<td class="product"><a href="#"><?php echo   $product_info['cate_name'];?></a></td>
						<td class="product title"><?php echo  $product_info['title'];?></td>
						<td class="product"><image src="/public/back/img/<?php echo  $product_info['images'];?>" class="product"/></td>
						<td class="product"><?php echo  number_format($product_info['price']);?>&nbsp;VNĐ</td>
						<td class="product"><?php echo  $product_info['sale_off'];?></td>
						<td class="product"><?php echo   $product_info['amount'];?></td>
						<td  class="product" style="width: 65px;"><a href="" title="Edit"><img src="/public/back/img/edit.ico"/></a>&nbsp;&nbsp;&nbsp;<img src="/public/back/img/delete.ico" onclick="delete_news()"/></td>
					</tr>
				<?php 
					$stt++;
				}?>
			</tbody>
		</table>
	</section><!--End table-->
	<section class="pagination">
		<?php echo $link;?>
	</section><!--End pagination-->
</section><!--End content-view-->
</form>